import { IconType, IconUtil } from '@xtail/vue3'
import Server2 from '@iconify-icons/tabler/server-2'
import { genFloderIcon } from '../../../utils'
import { HostConnConfTypeConstType, HostConnConfTypeConst } from '../consts'

/**
 * 生成服务器主机连接配置中的图标配置项的默认值
 *
 * @param {HostConnConfTypeConstType} type 服务器主机连接配置的类型
 * @returns {IconType} 图标配置项的默认值
 */
export const genHostConnConfDefaultIcon = (
  type: HostConnConfTypeConstType = HostConnConfTypeConst.HOST
): IconType => {
  if (type === HostConnConfTypeConst.DIR) return genFloderIcon()
  return IconUtil.genIcon({
    iconName: 'tabler:server-2',
    iconProps: {
      icon: Server2
    }
  })
}
